﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DHQGHN.DAL.DAO;
using DHQGHN.DAL.Models;

namespace DHQGHN.DAL.BO
{
    public class ServiceUsersBO : BaseBO
    {
        private ServiceUsersDAO _objDAO;
        public ServiceUsersBO()
        {
            _objDAO = new ServiceUsersDAO(Common.ConnectionUtil.DHQG_ADMIN_CONNECTION_STRING);
        }

        public bool CheckLogin(string userName, string password)
        {
            try
            {
                return _objDAO.CheckLogin(userName, password);
            }
            catch
            {
                throw;
            }
        }

        public List<ServiceMethodModel> GetServiceMethodByUserName(string userName)
        {
            try
            {
                Dictionary<string, string> mapDictionary = GetMapDictionary();
                return _objDAO.GetServiceMethodByUserName(userName, mapDictionary);
            }
            catch
            {
                throw;
            }
        }

        private Dictionary<string, string> GetMapDictionary()
        {
            Dictionary<string, string> mapDictionary = new Dictionary<string, string>();
            mapDictionary.Add("ServiceMethodId", "ServiceMethodId");
            mapDictionary.Add("MethodName", "MethodName");

            return mapDictionary;
        }
    }
}
